
let arrys = ["abc","ab","def"]
let returnArry = []
{

var a = []
var b = []
var c = []
var d = []
var e = []
var f = []
var g = []
var h = []
var i = []
var j = []
var k = []
var l = []
var m = []
var n = []
var o = []
var p = []
var q = []
var r = []
var s = []
var t = []
var u = []
var v = []
var w = []
var x = []
var y = []
var z = []


}

function sort(arr){

    for (let i = 0; i < arr.length; i++) {
        let element = arr[i].split('')
        switch (element[0]) {
            case "a":
                a.push(arr[i])
                break;
            case "b":
                b.push(arr[i])
                
                break;
            case "c":
                c.push(arr[i])
                
                break;
            case "d":
                d.push(arr[i])
                
                break;
            case "e":
                e.push(arr[i])
                
                break;
            case "f":
                f.push(arr[i])
                
                break;
            case "g":
                g.push(arr[i])
                
                break;
            case "h":
                h.push(arr[i])
                
                break;
            case "i":
                i.push(arr[i])
                
                break;
            case "j":
                j.push(arr[i])
                
                break;
            case "k":
                k.push(arr[i])
                
                break;
            case "l":
                l.push(arr[i])
                
                break;
            case "m":
                m.push(arr[i])
                
                break;
            case "n":
                n.push(arr[i])
                
                break;
            case "o":
                o.push(arr[i])
                
                break;
            case "p":
                p.push(arr[i])
                
                break;
            case "q":
                q.push(arr[i])
                
                break;
            case "r":
                r.push(arr[i])
                
                break;
            case "s":
                s.push(arr[i])
                
                break;
            case "t":
                t.push(arr[i])
                
                break;
            case "u":
                u.push(arr[i])
                
                break;
            case "v":
                v.push(arr[i])
                
                break;
            case "w":
                w.push(arr[i])
                
                break;
            case "x":
                x.push(arr[i])
                
                break;
            case "y":
                y.push(arr[i])
                
                break;
            case "z":
                z.push(arr[i])
                
                break;
            
            
        }
    }
    returnArry = returnArry.concat(a).concat(b).concat(c).concat(d).concat(e).concat(f).concat(g).concat(h).concat(i).concat(j).concat(k).concat(k).concat(l).concat(m).concat(n).concat(o).concat(p).concat(q).concat(r).concat(s).concat(t).concat(u).concat(v).concat(w).concat(x).concat(y).concat(z)
    console.log(returnArry);
}


sort(arrys)